import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('../views/tab/index.vue')
      },
      {
        path: '/course',
        name: 'course',
        component: () => import('../views/tab/course.vue')
      },
      {
        path: '/record',
        name: 'record',
        component: () => import('../views/tab/record.vue')
      },
      {
        path: '/practice',
        name: 'practice',
        component: () => import('../views/tab/practice.vue')
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('../views/tab/user.vue')
      }
    ],

  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/login.vue')
  },
  {
    path: '/info',
    name: 'info',
    component: () => import('../views/login/info.vue')
  },
  {
    path: '/option',
    name: 'option',
    component: () => import('../views/login/option.vue')
  },
  {
    path: '/custmoer',
    name: 'custmoer',
    component: () => import('../views/custmoer.vue')
  },
  {
    path: '/smslogin',
    name: 'smslogin',
    component: () => import('../views/login/smslogin.vue')
  },
  {
    path: '/setpassword',
    name: 'setpassword',
    component: () => import('../views/login/setpassword.vue')
  },
  {
    path: '/nickname',
    name: 'nickname',
    component: () => import('../views/user/nickname.vue')
  },
  {
    path: '/sex',
    name: 'sex',
    component: () => import('../views/user/sex.vue')
  },

]

const router = new VueRouter({
  routes
})

export default router
